package com.example.behaviorpattern.visitor.impl;

import com.example.behaviorpattern.visitor.Element;
import com.example.behaviorpattern.visitor.Visitor;

import java.util.function.Consumer;

/**
 * 具体元素B
 *
 * @author yaojianfeng
 */

public record ConcreteElementB(String name, int value) implements Element {


    @Override
    public void accept(Visitor visitor) {
        visitor.visit(this);
    }

    @Override
    public void operation(Consumer<Element> consumer) {
        consumer.accept(this);
    }
}